<script>
import KtMap from "/src/components/common/KtMap.vue";

export default {
  components: {KtMap},
  data(){
    return {
      title:"",
      data:{
        center:{
          // 经度
          longitude: 116.404000,
          // 纬度
          latitude: 39.928000,
        },
        "markers": [
          { "latitude": 39.928000, "longitude": 116.404000, "title": "San Francisco" },
        ]
      },
      show: false
    }
  },
  mounted(){
  },
  methods: {
    // 初始化地图
    open(title,data){
      this.title = title;
      this.data = data;
      this.show = true;
    },
    // 关闭
    close() {
      this.show = false;
    }
  }
}
</script>

<template>
  <el-dialog
      draggable
      width="550px"
      :title="title"
    v-model="show"
  @close="close"
  >
    <div style="text-align: center">
      <div
          class="map-box"
          v-if="show"
          style="display: inline-block;width: 500px;height: 400px;border-radius: 10px">
        <kt-map :data="data"></kt-map>
      </div>
    </div>
  </el-dialog>

</template>

<style scoped lang="scss">
.map-box{
  // 超出不显示
  overflow: hidden;
}
</style>